<template>
  <view class="p-h24 p-b24 bot-confirm">
    <view class="p-v40 flex">
      <text class="text-700-132">请确认是否参加面试</text>
    </view>
    <view class="flex">
      <image class="square-148 r-10" :src="info.images" mode="aspectFill" />
      <view class="flex-1 p-l20 overflow-hidden">
        <view class="flex">
          <text class="text-700-128 flex-1 truncate">{{ info.title }} {{ info.fringe }}</text>
          <text class="text-700-528">{{ info.money_range }}</text>
        </view>
        <view class="flex m-t12">
          <view class="flex p-h10 m-r10 r-4 h-44 tag">
            <text class="text-400-324">{{ info.area }}</text>
          </view>
          <view class="flex p-h10 m-r10 r-4 h-44 tag">
            <text class="text-400-324">{{ info.lowest_education }}</text>
          </view>
        </view>
        <view class="flex m-t12 overflow-hidden">
          <text class="text-400-326 flex-1 truncate">{{ info.address }}</text>
          <text class="text-400-326">{{ info.times }} 发布</text>
        </view>
      </view>
    </view>
    <view class="m-t50 flex">
      <view class="r-10 flex-c flex-1 h-76 confirm-btn"
        @click="jump('/pages/tab-page/interview-confirm/interview-confirm?id=' + info.id)">
        <text class="text-700-228">确认面试</text>
      </view>
      <view class="r-10 flex-c flex-1 m-l20 h-76 cancel-btn"
        @click="jump('/pages/tab-page/interview-reject/interview-reject?id=' + info.id)">
        <text class="text-700-328">礼貌拒绝</text>
      </view>
    </view>
    <view class="m-t44 text-c">
      <text class="text-400-126 tip">注：确认面试后将同意显示个人联系方式</text>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { defineProps, defineEmits, ref } from 'vue'
const props = defineProps({
  id: {
    type: Number,
    default: 0
  }
})
const emit = defineEmits<{
  (e: 'close'): void;
}>()

const jump = (url: string, close = true) => {
  if (close) {
    emit('close')
  }
  uni.navigateTo({
    url
  })
}
//获取面试详情
const info = ref({})
async function getDetail() {
  const res = await uni.$u.get('/msg/info', { id: props.id })
  info.value = res.data
}
getDetail()
</script>

<style lang="scss" scoped>
.bot-confirm {
  width: 100vw;
}

.tag {
  background-color: $bg-color-6;
}

.confirm-btn {
  background-color: $bg-color-2;
}

.cancel-btn {
  background-color: $bg-color-4;
}

.tip {
  color: #FF8B3D;
}
</style>
